package com.sinven.controller.manage;

import com.sinven.pojo.SinglePage;
import com.sinven.service.SinglePageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("manage")
public class SinglePageController {

    @Autowired
    private SinglePageService pageService;
    @GetMapping("pages/{code}")
    public SinglePage getPage(@PathVariable("code")String code){
        SinglePage singlePage = pageService.queryPage(code);
        return singlePage;
    }

    @PostMapping("pages")
    public boolean updatePage(SinglePage page){
        return pageService.updatePage(page);
    }
}
